package com.hmall.common.clients;

import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.intercept.MyFeignInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * @author zx
 * @date 2021/11/8 8:43
 */
@Component
@FeignClient(value = "itemservice",configuration = MyFeignInterceptor.class)
public interface FeginClient {

    @GetMapping("item/list")
    PageDTO<Item> list(@RequestParam(value = "page", defaultValue = "1") Integer page,
                       @RequestParam(value = "size", defaultValue = "5") Integer size);

    @DeleteMapping("item/{id}")
    void DeleteItem(@PathVariable(name = "id") Long id);

    @GetMapping("item/{id}")
    String findItemById(@PathVariable(name = "id") Long id);

    @GetMapping("item/downStock/{id}/{num}")
    boolean downItemStockById(@PathVariable(name = "id") Long id,@PathVariable(name = "num") Integer num);



}
